package com.school.springboot_login.dao;


import com.school.springboot_login.bean.AopLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/*
 * 对登录日志进行插入操作
 * */
@Repository
public class AopLogDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public void insertAopLoginLog(AopLog aopLog) {
        String sqlStr = "INSERT INTO aoplog(user_id,user_name,moduleName,operationDesc,createTime) "
                + "VALUES(?,?,?,?,?)";
        Object[] args = {aopLog.getUser_id(),aopLog.getUser_name(),aopLog.getModuleName(),aopLog.getOperationDesc(),aopLog.getCreateTime()};
        jdbcTemplate.update(sqlStr, args);
    }
}